<template>
    <div class="popup" style="max-width: 700px; margin: 0 auto ;">
      <!-- 蒙层 -->
      <transition name="fade">
        <div class="popup-overlay"  style="max-width: 750px;  margin: 0 auto ;" @click="clickMask" v-show="visible"></div>
      </transition>
      <!-- 弹出层 -->
      <transition name="slide">
        <div class="popup-content"  style="max-width: 700px;  margin: 0 auto ; height: 82%; " v-show="visible">
          <slot></slot>
        </div>
      </transition>
    </div>
  </template>
  <script>
  export default {
    props: {
      visible: Boolean,
    },
    methods: {
      clickMask() {
        this.$emit('update:visible', false);
      },
    },
  };
  </script>
  <style  scoped>
  .fade-enter-active,
  .fade-leave-active {
    transition: opacity 0.3s;
  }
  .fade-enter,
  .fade-leave-to {
    opacity: 0;
  }
  
  .slide-enter,
  .slide-leave-active {
    transform: translate3d(0, 100%, 0);
  }
  
  .popup .popup-overlay {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100vh;
    widows: 100vw;
    z-index: 2022;
    background: rgba($color: #0000006b, $alpha: 0.5);
  }
 .popup  .popup-content {
    width: 100%;
    position: fixed;
    bottom: 0;
    background: #fff;
    z-index: 2090;
    border-radius: 10px 10px ;
    transition: transform .3s;
    font-size: .1rem;
  }
  </style>